import 'package:fish_redux/fish_redux.dart';
import 'package:school_safe_teacher/Home/entity/news_entity.dart';


enum NewsListAction { action, search ,
  success,
  complete,
  onRefresh,
  onLoad,
}

class NewsListActionCreator {
  static Action onAction() {
    return const Action(NewsListAction.action);
  }

  static Action onSearch() {
    return const Action(NewsListAction.search);
  }

  static Action onSuccess(List<NewsEntity> list) {
    return Action(NewsListAction.success, payload: list);
  }

  static Action onComplete() {
    return Action(NewsListAction.complete);
  }

  static Action onRefresh() {
    return Action(NewsListAction.onRefresh);
  }

  static Action onLoad(int page) {
    return Action(NewsListAction.onLoad, payload: page);
  }
}
